package com.xishu.entity.foodPandaOrder;

import com.xishu.annotation.dao.DefaultValue;
import com.xishu.annotation.dao.FieldMapping;
import com.xishu.entity.AbstractEntity;
import io.swagger.annotations.ApiModelProperty;


import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Lob;
import javax.persistence.Transient;
import java.util.List;


@Entity(name = "foodPanda_order")
public class FoodPandaOrder extends AbstractEntity {

    private static final long serialVersionUID = -2819660723130957214L;

    @ApiModelProperty(value = "餐厅标识")
    private String remoteId;

    @ApiModelProperty(value = "JWT")
    private String token;


    @ApiModelProperty(value = "订单标识码")
    private String code;

    @Transient
    @ApiModelProperty(value = "订单备注")
    @FieldMapping(desField = "commentsJson", serialize = true,isObject = true)
    private Comments comments;

    @ApiModelProperty(value = "订单备注")
    @FieldMapping(desField = "comments",serialize = false,isObject = true,genericType = "com.xishu.entity.foodPandaOrder.Comments")
    private String commentsJson;

    @ApiModelProperty(value = "订单创建时间")
    private String createdAt;

    @Transient
    @ApiModelProperty(value = "客户信息")
    @FieldMapping(desField = "customerJson", serialize = true,isObject = true)
    private Customer customer;

    @ApiModelProperty(value = "客户信息")
    @FieldMapping(desField = "customer",serialize = false,isObject = true,genericType = "com.xishu.entity.foodPandaOrder.Customer")
    private String customerJson;


    @Transient
    @ApiModelProperty(value = "配送信息")
    @FieldMapping(desField = "deliveryJson", serialize = true,isObject = true)
    private Delivery delivery;

    @ApiModelProperty(value = "配送信息")
    @FieldMapping(desField = "delivery",serialize = false,isObject = true,genericType = "com.xishu.entity.foodPandaOrder.Delivery")
    private String deliveryJson;


    @Transient
    @ApiModelProperty(value = "折扣信息")
    @FieldMapping(desField = "discountsJson", serialize = true)
    private List<Discounts> discounts;

    @ApiModelProperty(value = "折扣信息")
    @FieldMapping(desField = "discounts",serialize = false,genericType = "com.xishu.entity.foodPandaOrder.Discounts")
    @Lob
    @Column(columnDefinition = "MEDIUMTEXT")
    private String discountsJson;


    @ApiModelProperty(value = "打包或者是配送")
    private String expeditionType;


    @ApiModelProperty(value = "订单失效时间")
    private String expiryDate;


    @Transient
    @ApiModelProperty(value = "本地信息")
    @FieldMapping(desField = "localInfoJson", serialize = true,isObject = true)
    private LocalInfo localInfo;

    @ApiModelProperty(value = "本地信息")
    @FieldMapping(desField = "localInfo", serialize = false,isObject = true,genericType = "com.xishu.entity.foodPandaOrder.LocalInfo")
    private String localInfoJson;


    @Transient
    @ApiModelProperty(value = "支付信息")
    @FieldMapping(desField = "paymentJson", serialize = true,isObject = true)
    private Payment payment;

    @ApiModelProperty(value = "支付信息")
    @FieldMapping(desField = "payment", serialize = false,isObject = true,genericType = "com.xishu.entity.foodPandaOrder.Payment")
    private String paymentJson;


    @ApiModelProperty(value = "是否测试订单")
    @DefaultValue(defaultValue = "false")
    private boolean test;

    @ApiModelProperty(value = "用于骑手区别餐厅")
    private String shortCode;


    @ApiModelProperty(value = "是否是预定订单")
    @DefaultValue(defaultValue = "false")
    private boolean preOrder;


    @Transient
    @ApiModelProperty(value = "取单信息")
    @FieldMapping(desField = "pickUpJson", serialize = true)
    private PickUp pickUp;

    @ApiModelProperty(value = "取单信息")
    @FieldMapping(desField = "pickUp", serialize = false,genericType = "com.xishu.entity.foodPandaOrder.PickUp")
    private String pickUpJson;


    @Transient
    @ApiModelProperty(value = "平台餐厅id")
    @FieldMapping(desField = "platformRestaurantJson", serialize = true,isObject = true)
    private PlatformRestaurant platformRestaurant;

    @ApiModelProperty(value = "平台餐厅id")
    @FieldMapping(desField = "platformRestaurant", serialize = false,isObject = true,genericType = "com.xishu.entity.foodPandaOrder.PlatformRestaurant")
    private String platformRestaurantJson;


    @Transient
    @ApiModelProperty(value = "价钱明细")
    @FieldMapping(desField = "priceJson", serialize = true,isObject = true)
    private Price price;

    @ApiModelProperty(value = "价钱明细")
    @FieldMapping(desField = "price", serialize = false,isObject = true,genericType = "com.xishu.entity.foodPandaOrder.Price")
    private String priceJson;

    @Transient
    @ApiModelProperty(value = "菜的信息")
    @FieldMapping(desField = "productsJson",serialize = true)
    private List<Products> products;

    @Lob
    @Column(columnDefinition = "MEDIUMTEXT")
    @ApiModelProperty(value = "菜的信息")
    @FieldMapping(desField = "products",serialize = false,genericType = "com.xishu.entity.foodPandaOrder.Products")
    private String productsJson;


    @ApiModelProperty(value = "已弃用字段")
    private boolean corporateOrder;

    @ApiModelProperty(value = "税号id")
    private String corporateTaxId;

    public String getRemoteId() {
        return remoteId;
    }

    public void setRemoteId(String remoteId) {
        this.remoteId = remoteId;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Comments getComments() {
        return comments;
    }

    public void setComments(Comments comments) {
        this.comments = comments;
    }

    public String getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(String createdAt) {
        this.createdAt = createdAt;
    }

    public Customer getCustomer() {
        return customer;
    }

    public void setCustomer(Customer customer) {
        this.customer = customer;
    }

    public Delivery getry() {
        return delivery;
    }

    public void setDelivery(Delivery delivery) {
        this.delivery = delivery;
    }


    public String getExpeditionType() {
        return expeditionType;
    }

    public void setExpeditionType(String expeditionType) {
        this.expeditionType = expeditionType;
    }

    public String getExpiryDate() {
        return expiryDate;
    }

    public void setExpiryDate(String expiryDate) {
        this.expiryDate = expiryDate;
    }

    public LocalInfo getLocalInfo() {
        return localInfo;
    }

    public void setLocalInfo(LocalInfo localInfo) {
        this.localInfo = localInfo;
    }


    public boolean isTest() {
        return test;
    }

    public void setTest(boolean test) {
        this.test = test;
    }

    public String getShortCode() {
        return shortCode;
    }

    public void setShortCode(String shortCode) {
        this.shortCode = shortCode;
    }

    public boolean isPreOrder() {
        return preOrder;
    }

    public void setPreOrder(boolean preOrder) {
        this.preOrder = preOrder;
    }

    public PickUp getPickUp() {
        return pickUp;
    }

    public void setPickUp(PickUp pickUp) {
        this.pickUp = pickUp;
    }

    public Payment getPayment() {
        return payment;
    }

    public void setPayment(Payment payment) {
        this.payment = payment;
    }

    public PlatformRestaurant getPlatformRestaurant() {
        return platformRestaurant;
    }

    public void setPlatformRestaurant(PlatformRestaurant platformRestaurant) {
        this.platformRestaurant = platformRestaurant;
    }

    public Price getPrice() {
        return price;
    }

    public void setPrice(Price price) {
        this.price = price;
    }


    public boolean isCorporateOrder() {
        return corporateOrder;
    }

    public void setCorporateOrder(boolean corporateOrder) {
        this.corporateOrder = corporateOrder;
    }

    public String getCorporateTaxId() {
        return corporateTaxId;
    }

    public void setCorporateTaxId(String corporateTaxId) {
        this.corporateTaxId = corporateTaxId;
    }
    public String getCommentsJson() {
        return commentsJson;
    }

    public void setCommentsJson(String commentsJson) {
        this.commentsJson = commentsJson;
    }

    public String getCustomerJson() {
        return customerJson;
    }

    public void setCustomerJson(String customerJson) {
        this.customerJson = customerJson;
    }

    public String getDeliveryJson() {
        return deliveryJson;
    }

    public void setDeliveryJson(String deliveryJson) {
        this.deliveryJson = deliveryJson;
    }

    public String getDiscountsJson() {
        return discountsJson;
    }

    public void setDiscountsJson(String discountsJson) {
        this.discountsJson = discountsJson;
    }

    public String getLocalInfoJson() {
        return localInfoJson;
    }

    public void setLocalInfoJson(String localInfoJson) {
        this.localInfoJson = localInfoJson;
    }

    public String getPaymentJson() {
        return paymentJson;
    }

    public void setPaymentJson(String paymentJson) {
        this.paymentJson = paymentJson;
    }

    public String getPickUpJson() {
        return pickUpJson;
    }

    public void setPickUpJson(String pickUpJson) {
        this.pickUpJson = pickUpJson;
    }

    public String getPlatformRestaurantJson() {
        return platformRestaurantJson;
    }

    public void setPlatformRestaurantJson(String platformRestaurantJson) {
        this.platformRestaurantJson = platformRestaurantJson;
    }

    public String getPriceJson() {
        return priceJson;
    }

    public void setPriceJson(String priceJson) {
        this.priceJson = priceJson;
    }


    public String getProductsJson() {
        return productsJson;
    }

    public void setProductsJson(String productsJson) {
        this.productsJson = productsJson;
    }

    public Delivery getDelivery() {
        return delivery;
    }

    public List<Discounts> getDiscounts() {
        return discounts;
    }

    public void setDiscounts(List<Discounts> discounts) {
        this.discounts = discounts;
    }

    public List<Products> getProducts() {
        return products;
    }

    public void setProducts(List<Products> products) {
        this.products = products;
    }
}
